import { http } from "@/utils/http";
import type { SelectDataType } from "./type";

type ResultTable = {
  total?: number;
  data?: Array<any>;
};

//查询人员（全部一级组织下的人员）
export const userlistPage = (data?: object) => {
  return http.request<SelectDataType>("post", `/account/user/listPage`, {
    data
  });
};

//查询全部排查计划状态(key,value)
export const basiclistPlanStatus = (data?: object) => {
  return http.request<ResultTable>("post", `/process/api/v1/check/basic/listPlanStatus`, {
    data
  });
};

//查询全部审批状态（key,value）
export const basiclistApproveStatus = (data?: object) => {
  return http.request<ResultTable>("post", `/process/api/v1/check/basic/listApproveStatus`, {
    data
  });
};

//查询排查计划列表(全部）
export const planqueryPage = (data?: object) => {
  return http.request<ResultTable>("post", `/process/api/v1/check/plan/queryPage`, {
    data
  });
};

//查询组织
export const deptfindByParentId = (data?: object) => {
  return http.request<ResultTable>("post", `/account/api/v1/dept/findByParentId?deptParentId=0`, {
    data
  });
};

//查询岗位
export const positionlistPositionOption = (data?: object) => {
  return http.request<ResultTable>("post", `/account/api/v1/position/listPositionOption`, {
    data
  });
};

//查询科室
export const basiclistAllClassRooms = (data?: object) => {
  return http.request<ResultTable>("post", `/process/api/v1/check/basic/listAllClassRooms`, {
    data
  });
};

//提交排查计划接口
export const plansubmit = (data?: object) => {
  return http.request<ResultTable>("post", `/process/api/v1/check/plan/submit`, {
    data
  });
};

//更新排查计划
export const planupdate = (data?: object) => {
  return http.request<ResultTable>("post", `/process/api/v1/check/plan/update`, {
    data
  });
};

//终止排查计划
export const planterminal = (data?: object) => {
  return http.request<ResultTable>("post", `/process/api/v1/check/plan/terminal`, {
    data
  });
};
